/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.wii.elpro.dao.jpa;

import com.wii.elpro.dao.JPAUtil;
import com.wii.elpro.dao.StandartSpecificationInterface;
import com.wii.elpro.entity.StandartSpecification;
import java.util.List;
import javax.persistence.EntityManager;

/**
 *
 * @author hendro
 */
public class StandartSpecificationImpl extends DAOGenericImpl implements StandartSpecificationInterface{

    public StandartSpecification getStandartSpecification(long id) throws Exception {
        JPAUtil.beginTransaction();
        EntityManager em = JPAUtil.getEntityManager();
        try {
            return em.find(StandartSpecification.class, id);
        } catch (Exception ex) {
            throw ex;
        }
    }

    public List<StandartSpecification> getStandartSpecifications() throws Exception {
        JPAUtil.beginTransaction();
        EntityManager em = JPAUtil.getEntityManager();
        try {
            return em.createQuery("SELECT d FROM StandartSpecification d").getResultList();
        } catch (Exception ex) {
            throw ex;
        }
    }  
    
}
